/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ModelLayer;

/**
 *
 * @author R3l4X
 */
public class SalesLine {
    
    private int quantity;
    private Product product;
    private int SalesLineID;
    private Sale sale;


    
    public SalesLine() {
    }

    public SalesLine(Sale sale, Product product, int quantity)
    {
        this.quantity = quantity;
        this.product = product;
        this.sale = sale;
    }

    public int getQuantity() {
        return quantity;
    }

    public void setQuantity(int quantity) {
        this.quantity = quantity;
    }
  
    public Product getProduct()
    {
        return product;
    }

    public void setProduct(Product product)
    {
        this.product = product;
    }

    public Sale getSale()
    {
        return sale;
    }

    public void setSale(Sale sale)
    {
        this.sale = sale;
    }


    public String getProductType()
    {
        return product.getType();
    }

    public double getPrice()
    {
        return product.getPrice();
    }

    public int getSalesLineID() {
        return SalesLineID;
    }

    public void setSalesLineID(int SalesLineID) {
        this.SalesLineID = SalesLineID;
    }
    
    public double CalcuatePrice()
    {
        double price = product.getPrice();
        double totalPrice = 0;
        totalPrice = (totalPrice + price) * getQuantity();
        return totalPrice;
    }
    
    public int getProductID()
    {
        return product.getProductID();
    }
    
    public void setProductID(Product id)
    {
        this.product = id;
    }
    
    
   
    public String getProductInfo()
    {
        return "\nProduct : " + getProductType() + ". Quantity : " + getQuantity() +
                ". Price per product: " + getPrice() + " kr." + " Totally Price : " +
                CalcuatePrice();
    }
}
